package game;

public class Bullet extends Entity {
    
    //constants for bullet sizes, to plut into arrays below
    public static final int SMALL = 0;
    public static final int MEDIUM = 1;
    public static final int LARGE = 2;
    public static final int PLAYER = 3;
    
    //constants for updates and whatnot
    public static final int ENERGY_COST = 5;
    public static final int VELOCITY = 4;
    public final static int[] collisionRadius = {7,11,15,10};
    public final static int[] velocity = {7,3,2,8};
    public final static int[] energyCost = {5,9,11};
    private static Boundary screenBoundary;
    
    public final int size;
    public boolean nearMiss;
    public boolean tooClose;
    
    public Bullet(float x, float y, double angle, int bulletSize) {
	super(x, y, screenBoundary);
	this.angle = angle;
	size = bulletSize;
	nearMiss = false;
	tooClose = false;
    }

    /** Called once to set boundary for all bullets, set size to screen size */
    public void setBounds(Boundary screenBounds) {
	screenBoundary = screenBounds;
    }
    
    @Override
    public void update() {
	x += VELOCITY * Math.cos(angle);
	y += VELOCITY * Math.sin(angle);
    }

    public static String toString(int bulletSize) {
	return "Bullet: radius " + collisionRadius[bulletSize];
    }
}
